<template>
	<view>
		<view class="my-search-container" :style="{backgroundColor: bgColor}">
			<view class="my-search-box" :style="{borderRadius: radius + 'px'}" @click="search()">
				<icon :type="'search'"></icon>
				<text class="placeholder">搜索</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "my-search",
		data() {
			return {

			};
		},
		props: {
			bgColor: {
				required: false,
				default: "#0055ff",
				type: String
			},
			radius: {
				type: Number,
				default: 15
			}
		},
		methods: {
			search() {
				this.$emit("click")
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my-search-container {
		height: 50px;
		display: flex;
		align-items: center;
		background-color: #0055ff;
		padding: 0 10px;

		.my-search-box {
			width: 100%;
			display: flex;
			justify-content: center;
			background-color: #ffffff;
			height: 36px;
			border-radius: 15px;
			align-items: center;

			.placeholder {
				font-size: 15px;
				margin-left: 5px;
			}
		}
	}
</style>
